package com.fuxi.cloud.desreport.dao;

import com.fuxi.cloud.desreport.entity.JmReportDb;
import org.jeecgframework.minidao.annotation.Param;
import org.jeecgframework.minidao.annotation.ResultType;
import org.jeecgframework.minidao.annotation.Sql;
import org.jeecgframework.minidao.pojo.MiniDaoPage;
import org.springframework.stereotype.Repository;

import java.util.List;
import java.util.Map;

/**
 * JimuReportDbDao
 *
 * @Author: 扫地僧
 * @CreateTime: 2021-05-03
 */
@Repository
public interface JimuReportDbDao {
    @Sql("SELECT * FROM jimu_report_db WHERE ID = :id")
    JmReportDb get(@Param("id") String var1);

    int update(@Param("jimuReportDb") JmReportDb var1);

    void insert(@Param("jimuReportDb") JmReportDb var1);

    @ResultType(JmReportDb.class)
    MiniDaoPage<JmReportDb> getAll(@Param("jimuReportDb") JmReportDb var1, @Param("page") int var2, @Param("rows") int var3);

    @Sql("DELETE from jimu_report_db WHERE ID = :id")
    void delete(@Param("id") String var1);

    @Sql("DELETE from jimu_report_db WHERE ID = :id")
    void deleteById(@Param("id") String var1);

    @ResultType(JmReportDb.class)
    @Sql("SELECT * FROM jimu_report_db WHERE JIMU_REPORT_ID = :jimuReportId")
    List<JmReportDb> selectList(@Param("jimuReportId") String var1);

    @ResultType(Map.class)
    List<Map<String, Object>> selectListBySql(@Param("dbDynSql") String var1);

    @Sql("SELECT COUNT(*) FROM jimu_report_db WHERE JIMU_REPORT_ID=:reportId and is_page='1'")
    int getCountByReportId(@Param("reportId") String var1);

    @ResultType(Map.class)
    MiniDaoPage<Map<String, Object>> selectPageBySql(@Param("querySql") String var1, @Param("page") int var2, @Param("rows") int var3);

    @Sql("SELECT COUNT(*) FROM jimu_report_db WHERE JIMU_REPORT_ID=:reportId and db_code=:code")
    int getCount(@Param("reportId") String var1, @Param("code") String var2);

    @ResultType(JmReportDb.class)
    @Sql("SELECT * FROM jimu_report_db WHERE JIMU_REPORT_ID=:reportId and db_code=:code")
    JmReportDb getReportDb(@Param("reportId") String var1, @Param("code") String var2);
}

